/* /\**************************************************************** */
/*  * Fulguro */
/*  * Copyright (C) 2004 Christophe Clienti */
/*  * */
/*  * This library is free software; you can redistribute it and/or */
/*  * modify it under the terms of the GNU Lesser General Public */
/*  * License as published by the Free Software Foundation; either */
/*  * version 2 of the License, or (at your option) any later version. */
/*  * */
/*  * This library is distributed in the hope that it will be useful, */
/*  * but WITHOUT ANY WARRANTY; without even the implied warranty of */
/*  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */
/*  * Lesser General Public License for more details. */
/*  * */
/*  * You should have received a copy of the GNU Lesser General Public */
/*  * License along with this library; if not, write to the */
/*  * Free Software Foundation, Inc., 59 Temple Place - Suite 330, */
/*  * Boston, MA 02111-1307, USA. */
/*  ***************************************************************\/ */


%module (docstring="Fulguro Data Tools Module") flgrdatatools
/* %include "typemaps.i" */

/* %include ../common/common.i */

/*  /\*********************** Include for wrapper **********************\/ */

/* %inline %{ */

/* #include <flgrCoreTypes.h> */
/* #include <flgrCoreErrors.h> */
/* #include <flgrCoreData.h> */
/* #include <flgrDataToolsPStack.h> */

/*   %} */


/* struct FLGR_Stack { */
/*   %immutable; */
/*   //void *priorityLabel; */
/*   int size; */
/*   FLGR_Type type;      */
/*   //FLGR_StackLink *top; */
/*   FLGR_Stack *next; */
/*   FLGR_Stack *previous; */
/*   %mutable; */
/* }; */

/* typedef struct { */
/*   %immutable; */
/*   int nbPriority; //!< Number of stack */
/*   FLGR_Stack *first;  //!< pointer to first Stack structure */
/*   FLGR_Stack *last;   //!< pointer to last Stack structure */
/*   FLGR_Type type;     //!< Type used in functions using priority stack */
/*   %mutable; */
/* }FLGR_PStack; */

/* %extend FLGR_Stack { */
/*   ~FLGR_Stack() { */

/*   } */

/* } */
/* %extend FLGR_PStack { */
/*   ~FLGR_PStack() { */
/*     flgr_pstack_destroy($self); */
/*   }   */
/* } */

/* /\*********************** Documentation ***********************\/ */

/* %feature("autodoc",""" */
/* [in] String (type) */
/* [return] TPriotyStack\n */
/* Construct a Priority Stack */
/* """) flgr_pstack_create; */

/* %feature("autodoc",""" */
/* [in] FLGR_PStack */
/* [in] priority */
/* [return] FLGR_Stack\n */
/* Get a specific priority stack */
/* """) flgr_pstack_get_stack; */

/* %feature("autodoc",""" */
/* [in] FLGR_PStack */
/* [return] FLGR_Stack\n */
/* Get the first non-empty stack. Scan is made from lesser priority to higher priority. */
/* """) flgr_pstack_get_first_no_empty_stack; */

/* %feature("autodoc",""" */
/* [in] FLGR_PStack */
/* [return] FLGR_Stack\n */
/* Get the first non-empty stack. Scan is made from higher priority to lesser priority. */
/* """) flgr_pstack_get_last_no_empty_stack; */

/* %feature("autodoc",""" */
/* [in] FLGR_PStack */
/* [in] priority */
/* [in] row */
/* [in] col */
/* [return] FLGR_RET_OK, ...\n */
/* Push pixel coordinates in the priority stack at the given priority */
/* """) flgr_pstack_push; */

/* %feature("autodoc",""" */
/* [in] FLGR_Stack */
/* [return] [FLGR_RET_OK, ROW, COLUMN] */
/* Get pixel coordinates at the top of the stack */
/* """) flgr_pstack_pop_stack; */

/* %feature("autodoc",""" */
/* [in] FLGR_Stack */
/* [in] row */
/* [in] col */
/* [return] FLGR_RET_OK, ...\n */
/* Set pixel coordinates at the top of the stack */
/* """) flgr_pstack_push_stack; */

/* %feature("autodoc",""" */
/* [in] FLGR_Stack */
/* [return] boolean\n */
/* Test if a stack extracted from a priority stack is the last (higher priority) */
/* """) flgr_pstack_is_last_stack; */

/* %feature("autodoc",""" */
/* [in] FLGR_Stack */
/* [return] return the stack priority label */
/* """) flgr_pstack_get_label_stack; */

/* /\*********************** Set Typemap ***********************\/ */

/* /\* %typecheck(SWIG_TYPECHECK_DOUBLE) void * { *\/ */
/* /\*   $1 = (SwigCheckDblType || SwigCheckIntType) ? 1 : 0; *\/ */
/* /\*  } *\/ */

/* /\* %typemap(in) (void *) { *\/ */
/* /\*   if(arg1->type==FLGR_UINT8) { *\/ */
/* /\*     $1 = malloc(sizeof(fgUINT8)); *\/ */
/* /\*     *((fgUINT8*) $1) = (fgUINT8) (CInt_FromSwigInt($input)); *\/ */

/* /\*   }else if(arg1->type==FLGR_UINT16) {	 *\/ */
/* /\*     $1 = malloc(sizeof(fgUINT16)); *\/ */
/* /\*     *((fgUINT16*) $1) = (fgUINT16) (CInt_FromSwigInt($input)); *\/ */
    
/* /\*   }else if(arg1->type==FLGR_UINT32) {	 *\/ */
/* /\*     $1 = malloc(sizeof(fgUINT32)); *\/ */
/* /\*     *((fgUINT32*) $1) = (fgUINT32) (CUInt_FromSwigInt($input)); *\/ */
    
/* /\*   }else if(arg1->type==FLGR_INT8) {	 *\/ */
/* /\*     $1 = malloc(sizeof(fgINT8)); *\/ */
/* /\*     *((fgINT8*) $1) = (fgINT8) (CInt_FromSwigInt($input)); *\/ */
    
/* /\*   }else if(arg1->type==FLGR_INT16) {	 *\/ */
/* /\*     $1 = malloc(sizeof(fgINT16)); *\/ */
/* /\*     *((fgINT16*) $1) = (fgINT16) (CInt_FromSwigInt($input)); *\/ */
    
/* /\*   }else if(arg1->type==FLGR_INT32) {	 *\/ */
/* /\*     $1 = malloc(sizeof(fgINT32)); *\/ */
/* /\*     *((fgINT32*) $1) = (fgINT32) (CInt_FromSwigInt($input)); *\/ */
    
/* /\*   }else if(arg1->type==FLGR_FLOAT32) {		 *\/ */
/* /\*     $1 = malloc(sizeof(fgFLOAT32)); *\/ */
/* /\*     *((fgFLOAT32*) $1) = (fgFLOAT32) (CInt_FromSwigInt($input)); *\/ */
    
/* /\*   }else if(arg1->type==FLGR_FLOAT64) {	 *\/ */
/* /\*     $1 = malloc(sizeof(fgFLOAT64)); *\/ */
/* /\*     *((fgFLOAT64*) $1) = (fgFLOAT64) (CInt_FromSwigInt($input)); *\/ */
    
/* /\*   }else {					 *\/ */
/* /\*     POST_ERROR("unknown type %sn",arg1->type); *\/ */
/* /\*   }		   *\/ */
/* /\* } *\/ */

/* /\* %typemap(freearg) (void *) { *\/ */
/* /\*   free($1); *\/ */
/* /\* } *\/ */




/* /\*********************** Functions ***********************\/ */

/* FLGR_PStack *flgr_pstack_create(int spp, FLGR_Type type); */
/* FLGR_Stack *flgr_pstack_get_stack(FLGR_PStack *pstack, FLGR_Vector *priorityLabel); */
/* FLGR_Stack *flgr_pstack_get_first_no_empty_stack(FLGR_PStack *pstack); */
/* FLGR_Stack *flgr_pstack_get_last_no_empty_stack(FLGR_PStack *pstack); */

/* FLGR_Ret flgr_pstack_push(FLGR_PStack *pstack, FLGR_Vector *priorityLabel, int row, int column); */
/* FLGR_Ret flgr_pstack_pop_stack(FLGR_Stack *stk, int *OUTPUT, int *OUTPUT); */
/* FLGR_Ret flgr_pstack_push_stack(FLGR_Stack *stk, int row, int col); */

/* //%clear void*; */


/* int flgr_pstack_is_last_stack(FLGR_Stack *stack); */





/* /\* %typemap(in) FLGR_Stack * (FLGR_Type stacktype) { *\/ */
/* /\*   if ((SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor,0)) == -1) return SwigObjectEmpty; *\/ */
/* /\*   stacktype = $1->type; *\/ */
/* /\* } *\/ */


/* /\* %typemap(out) (void *) { *\/ */
/* /\*   switch(stacktype1) { *\/ */
/* /\*   case FLGR_BIT:     $result = SwigInt_FromCInt((int) FLGR_PVOID_VAL(fgBIT, $1)); break; *\/ */
/* /\*   case FLGR_UINT8:   $result = SwigInt_FromCInt((int) FLGR_PVOID_VAL(fgUINT8, $1)); break; *\/ */
/* /\*   case FLGR_UINT16:  $result = SwigInt_FromCInt((int) FLGR_PVOID_VAL(fgUINT16, $1)); break; *\/ */
/* /\*   case FLGR_UINT32:  $result = SwigInt_FromCUInt((unsigned int) FLGR_PVOID_VAL(fgUINT32, $1)); break; *\/ */
/* /\*   case FLGR_INT8:    $result = SwigInt_FromCInt((int) FLGR_PVOID_VAL(fgINT8, $1)); break; *\/ */
/* /\*   case FLGR_INT16:   $result = SwigInt_FromCInt((int) FLGR_PVOID_VAL(fgINT16, $1)); break; *\/ */
/* /\*   case FLGR_INT32:   $result = SwigInt_FromCInt((int) FLGR_PVOID_VAL(fgINT32, $1)); break; *\/ */
/* /\*   case FLGR_FLOAT32: $result = SwigFloat_FromCDouble((double) FLGR_PVOID_VAL(fgFLOAT32, $1)); break; *\/ */
/* /\*   case FLGR_FLOAT64: $result = SwigFloat_FromCDouble((double) FLGR_PVOID_VAL(fgFLOAT64, $1)); break; *\/ */
/* /\*   default: *\/ */
/* /\*     POST_ERROR("unknown type\n"); *\/ */
/* /\*     free($1); *\/ */
/* /\*     return SwigObjectEmpty; *\/ */
/* /\*   } *\/ */
/* /\* } *\/ */

/* FLGR_Vector *flgr_pstack_get_label_stack(FLGR_Stack*); */
